<?php
$this->breadcrumbs = array(
    'BusDetail Manager' => array('index'),
);
?>
<div class="box">
    <header>
        <h5>BusDetail Manager</h5>
    </header>
    <div class="body">

        <?php
        $this->widget('bootstrap.widgets.TbGridView', array(
            'id' => 'subscriber-grid',
            'dataProvider' => $models->search(),
            'filter' => $models,
            'columns' => array(
                array(
                    'header' => '#',
                    'name' => 'bus_detail_id',
                    'htmlOptions' => array('width' => '50')),
                array(
                    'name' => 'bus.name',
                ),
                array(
                    'name' => 'start_point',
                    'htmlOptions' => array('width' => '100')),
                array(
                    'name' => 'end_point',
                    'htmlOptions' => array('width' => '100')),
                array(
                    'header' => 'Direction',
                    'value' => '$data->direction == 1 ? "Yes"  : "No"',
                    'htmlOptions' => array('width' => '50'),
                ),
                array(
                    'header' => 'Manage Station',
                    'value' => function($data) {
                        $sLink = CHtml::link('Stations', url('busstation/index', array('id' => $data->bus_detail_id)));
                        return $sLink;
                    },
                    'type' => 'html',
                ),
                array(
                    'header' => 'Manage Trip',
                    'value' => function($data) {
                        $sLink = CHtml::link('Trips', url('bustrip/index', array('id' => $data->bus_detail_id)));
                        return $sLink;
                    },
                    'type' => 'html',
                ),
                array(
                    'class' => 'bootstrap.widgets.TbButtonColumn',
                    'template' => '{update}'
                ),
            ),
        ));
        ?>
    </div>
</div>

